//
// Created by haoy on 2017/6/20.
//

#ifndef RTC_XSWITCH2_RTP_MAP_HPP
#define RTC_XSWITCH2_RTP_MAP_HPP

#include <list>
#include <map>
#include <string>

class RtpMap {
public:
    // todo: create a Codec class which holds such parameters
    class Parameters {
    public:
        // H.264
        uint8_t level_asymmetry_allowed;
        uint8_t packetization_mode;
        std::string profile_level_id;
        // opus
        int minptime;
        int maxptime;
        int useinbandfec;
    };
public:
    void add_back(const uint8_t pt, const int c);
    uint8_t pt(const int c) const;
    int codec(const uint8_t pt) const;
    std::list<int> codecs() const;
    Parameters parameters(int c) const;
    void setParameters(int c, const Parameters& p);
private:
    std::list<int> codecs_;
    std::map<uint8_t, int> pt2c_;
    std::map<int, uint8_t> c2pt_;
    std::map<int, Parameters> parameters_;
};


#endif //RTC_XSWITCH2_RTP_MAP_HPP
